﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hardcodet.Wpf.GenericTreeView;
using ChoWorkflowServer.Model;

namespace ChoWorkflowDashboard
{
    public class ChoTasksTree : TreeViewBase<ChoTaskGroupCategory>
    {
        public override string GetItemKey(ChoTaskGroupCategory item)
        {
            return item.GetHashCode().ToString();
        }
        public override ICollection<ChoTaskGroupCategory> GetChildItems(ChoTaskGroupCategory parent)
        {
            return parent.Tasks;
        }
        public override ChoTaskGroupCategory GetParentItem(ChoTaskGroupCategory item)
        {
            return item != null ? item.Parent : null;
        }
    }
}
